//封装所有关于组织架构的方法

//导入instance
import instance from '@/utils/request'

//获取组织架构的数据
export function getDepartmentsApi () {
  return instance({
    url: '/company/department'
  })
}

//删除组织架构的接口
export function delDepartApi (id) {
  return instance({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

//新增组织架构的接口
export function addDepartApi (data) {
  return instance({
    url: '/company/department',
    method: 'post',
    data
  })
}

//根据ID查询部门详情
export function getDepIdApi(id) {
  return instance({
    url: `/company/department/${id}`,
    method:'GET'
  })
}

//根据ID修改部门详情
export function editDepartApi(data) {
  return instance({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}